//
//  ListView.m
//  Candy
//
//  Created by 牛魔王 on 2018/8/29.
//  Copyright © 2018年 庄文盛 All rights reserved.
//

#import "ListView.h"
#import "ListModel.h"

@implementation ListView

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (IBAction)selectAct:(id)sender {
    if (_selectAction) {
        self.selectAction();
    }
}

- (void)setCellValue:(ListModel *)model {
    self.headImage.image = [UIImage imageNamed:model.image];
    self.titleLable.text = model.title;
    self.amoutLable.text = model.amout;
    self.contentLable.text = model.content;
    self.amoutLable.text =[NSString stringWithFormat:@"葡萄：%@",model.amout];
    if ([model.state isEqualToString:@"1"]) {
        self.state.text = @"状态：已完成";
    }
    else if ([model.state isEqualToString:@"2"]){
        self.state.text = @"状态：进行中";
    }
    else {
        self.state.text = @"状态：";
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
